/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.taobao.ibatiside.model.configv2.impl;

import java.math.BigInteger;

import org.eclipse.emf.common.notify.Notification;

import org.eclipse.emf.ecore.EClass;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.taobao.ibatiside.model.configv2.Configv2Package;
import org.taobao.ibatiside.model.configv2.TypeHandlerType;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Type Handler Type</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.taobao.ibatiside.model.configv2.impl.TypeHandlerTypeImpl#getCallback <em>Callback</em>}</li>
 *   <li>{@link org.taobao.ibatiside.model.configv2.impl.TypeHandlerTypeImpl#getJavaType <em>Java Type</em>}</li>
 *   <li>{@link org.taobao.ibatiside.model.configv2.impl.TypeHandlerTypeImpl#getJdbcType <em>Jdbc Type</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class TypeHandlerTypeImpl extends EObjectImpl implements TypeHandlerType {
	/**
	 * The default value of the '{@link #getCallback() <em>Callback</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCallback()
	 * @generated
	 * @ordered
	 */
	protected static final String CALLBACK_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getCallback() <em>Callback</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getCallback()
	 * @generated
	 * @ordered
	 */
	protected String callback = CALLBACK_EDEFAULT;

	/**
	 * The default value of the '{@link #getJavaType() <em>Java Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJavaType()
	 * @generated
	 * @ordered
	 */
	protected static final String JAVA_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getJavaType() <em>Java Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJavaType()
	 * @generated
	 * @ordered
	 */
	protected String javaType = JAVA_TYPE_EDEFAULT;

	/**
	 * The default value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJdbcType()
	 * @generated
	 * @ordered
	 */
	protected static final String JDBC_TYPE_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getJdbcType()
	 * @generated
	 * @ordered
	 */
	protected String jdbcType = JDBC_TYPE_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected TypeHandlerTypeImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return Configv2Package.Literals.TYPE_HANDLER_TYPE;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getCallback() {
		return callback;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setCallback(String newCallback) {
		String oldCallback = callback;
		callback = newCallback;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Configv2Package.TYPE_HANDLER_TYPE__CALLBACK, oldCallback, callback));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getJavaType() {
		return javaType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setJavaType(String newJavaType) {
		String oldJavaType = javaType;
		javaType = newJavaType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Configv2Package.TYPE_HANDLER_TYPE__JAVA_TYPE, oldJavaType, javaType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getJdbcType() {
		return jdbcType;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setJdbcType(String newJdbcType) {
		String oldJdbcType = jdbcType;
		jdbcType = newJdbcType;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, Configv2Package.TYPE_HANDLER_TYPE__JDBC_TYPE, oldJdbcType, jdbcType));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case Configv2Package.TYPE_HANDLER_TYPE__CALLBACK:
				return getCallback();
			case Configv2Package.TYPE_HANDLER_TYPE__JAVA_TYPE:
				return getJavaType();
			case Configv2Package.TYPE_HANDLER_TYPE__JDBC_TYPE:
				return getJdbcType();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case Configv2Package.TYPE_HANDLER_TYPE__CALLBACK:
				setCallback((String)newValue);
				return;
			case Configv2Package.TYPE_HANDLER_TYPE__JAVA_TYPE:
				setJavaType((String)newValue);
				return;
			case Configv2Package.TYPE_HANDLER_TYPE__JDBC_TYPE:
				setJdbcType((String)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case Configv2Package.TYPE_HANDLER_TYPE__CALLBACK:
				setCallback(CALLBACK_EDEFAULT);
				return;
			case Configv2Package.TYPE_HANDLER_TYPE__JAVA_TYPE:
				setJavaType(JAVA_TYPE_EDEFAULT);
				return;
			case Configv2Package.TYPE_HANDLER_TYPE__JDBC_TYPE:
				setJdbcType(JDBC_TYPE_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case Configv2Package.TYPE_HANDLER_TYPE__CALLBACK:
				return CALLBACK_EDEFAULT == null ? callback != null : !CALLBACK_EDEFAULT.equals(callback);
			case Configv2Package.TYPE_HANDLER_TYPE__JAVA_TYPE:
				return JAVA_TYPE_EDEFAULT == null ? javaType != null : !JAVA_TYPE_EDEFAULT.equals(javaType);
			case Configv2Package.TYPE_HANDLER_TYPE__JDBC_TYPE:
				return JDBC_TYPE_EDEFAULT == null ? jdbcType != null : !JDBC_TYPE_EDEFAULT.equals(jdbcType);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (callback: ");
		result.append(callback);
		result.append(", javaType: ");
		result.append(javaType);
		result.append(", jdbcType: ");
		result.append(jdbcType);
		result.append(')');
		return result.toString();
	}

} //TypeHandlerTypeImpl
